<?php


class Junction_Criterion 
{
	/**
	 * Equal operator.
	 * 
	 * @var int
	 */
	public static $EQUAL = '=';
	
	/**
	 * Not equal operator.
	 * 
	 * @var int
	 */
	public static $NOT_EQUAL = '!=';
	
	/**
	 * Greater than operator.
	 * 
	 * @var int
	 */
	public static $GREATER_THAN = '>';
	
	/**
	 * Less than operator
	 * 
	 * @var int
	 */
	public static $LESS_THAN = '<';
	
	/**
	 * Greater than or equal to operator.
	 * 
	 * @var int
	 */
	public static $GREATER_THAN_OR_EQUAL = '>=';
	
	/**
	 * Less than or equal to operator.
	 * 
	 * @var int
	 */
	public static $LESS_THAN_OR_EQUAL = '<=';
	
	/**
	 * In operator.
	 * 
	 * @var int
	 */
	public static $IN = ' IN ';
	
	private $_lhs;
	
	private $_rhs;
	
	private $_operand;
	
	private $_andCriteria;
	
	private $_orCriteria;
	
	public function __construct($lhs, $operator, $rhs)
	{
		$this->_lhs = $lhs;
		$this->_rhs = $rhs;
		$this->_operator = $operator;
		
		$this->_orCriteria = array();
		$this->_andCriteria = array();
	}
	
	public function addOr(Junction_Criterion $criterion)
	{
		$this->_orCriteria[] = $criterion;
	}
	
	public function addAnd(Junction_Criterion $criterion)
	{
		$this->_andCriteria[] = $criterion;
	}
	
	public function getOrCriteria()
	{
		return $this->_orCriteria;
	}
	
	public function getAndCriteria()
	{
		return $this->_andCriteria;
	}
	
	public function getLeftHandOperand()
	{
		return $this->_lhs;
	}
	
	public function getRightHandOperand()
	{
		return $this->_rhs;
	}
	
	public function getOperator()
	{
		return $this->_operator;
	}
}
?>